setwd("/Users/moch/Dropbox/SMOKING/Replication Files/S4_Appendix/CPS")
data1 <- read.csv("CPS09.csv")

attach(data1)

sum(MARSUPWT[A_SEX==1 & A_AGE>=18])/sum(MARSUPWT[A_AGE>=18]) # Male
sum(MARSUPWT[A_SEX==2 & A_AGE>=18])/sum(MARSUPWT[A_AGE>=18]) # Female


sum(MARSUPWT[A_AGE<25 & A_AGE>=18])/sum(MARSUPWT[A_AGE>=18]) # 18-24
sum(MARSUPWT[A_AGE<35 & A_AGE>=25])/sum(MARSUPWT[A_AGE>=18]) # 25-34
sum(MARSUPWT[A_AGE<45 & A_AGE>=35])/sum(MARSUPWT[A_AGE>=18]) # 35-44
sum(MARSUPWT[A_AGE<55 & A_AGE>=45])/sum(MARSUPWT[A_AGE>=18]) # 45-54
sum(MARSUPWT[A_AGE<65 & A_AGE>=55])/sum(MARSUPWT[A_AGE>=18]) # 55-64
sum(MARSUPWT[A_AGE>=65])/sum(MARSUPWT[A_AGE>=18]) # 65+



white <- PRDTRACE==1
white[PRDTRACE==6] <- 1
white[PRDTRACE==7] <- 1
white[PRDTRACE==8] <- 1
white[PRDTRACE==9] <- 1
white[PRDTRACE==15] <- 1
white[PRDTRACE==16] <- 1
white[PRDTRACE==17] <- 1
white[PRDTRACE==18] <- 1
white[PRDTRACE==19] <- 1

sum(MARSUPWT[white==1 & A_AGE>=18])/sum(MARSUPWT[A_AGE>=18])


sum(MARSUPWT[PEHSPNON==1 & A_AGE>=18])/sum(MARSUPWT[A_AGE>=18]) #Hisp


sum(MARSUPWT[A_HGA<=38 & A_AGE>=18])/sum(MARSUPWT[A_AGE>=18]) # LT HS
sum(MARSUPWT[A_HGA==39 & A_AGE>=18])/sum(MARSUPWT[A_AGE>=18]) # HS Grad
sum(MARSUPWT[A_HGA>39 & A_HGA<43 &A_AGE>=18])/sum(MARSUPWT[A_AGE>=18]) # Some Col
sum(MARSUPWT[A_HGA==43 &A_AGE>=18])/sum(MARSUPWT[A_AGE>=18]) # College Grad
sum(MARSUPWT[A_HGA>43 &A_AGE>=18])/sum(MARSUPWT[A_AGE>=18]) # Grad School
